<template>
	<view>
		<uni-table stripe emptyText="暂无更多数据">
			<uni-tr>
				<uni-th align="center">离校人姓名</uni-th>
				<uni-th align="center">离校人头像</uni-th>
				<uni-th align="center">离校起始</uni-th>
				<uni-th align="center">离校结束</uni-th>
				<uni-th align="center">离校状态</uni-th>
			</uni-tr>
			<uni-tr  @click.native="trclick(item.id)" v-for="(item,index) in pastlist" :key="index">
				<uni-td align="center">{{item.studentName}}</uni-td>
				<uni-td align="center">
					<image style="width: 100rpx;" :src="base+item.imgavater" mode="widthFix"></image>
				</uni-td>
				<uni-td align="center">{{item.leaveTimeStart}}</uni-td>
				<uni-td align="center">{{item.leaveTimeEnd}}</uni-td>
				<uni-td align="center">{{paststat[item.state-1]}}</uni-td>
			</uni-tr>
		</uni-table>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				base:'',
				paststat:["已确认离校","未确认离校"],
				pastlist:[]
			}
		},
		onLoad() {
			this.base=this.$request.baseurl
			this.getpastlist()
		},
		methods: {
			trclick(id){
				uni.navigateTo({
					url:'/pages/pastinfo/pastinfo?id='+id
				})
			},
			async getpastlist(){
				const res=await this.$request.pastlist()
				console.log(res)
				this.pastlist=res.data.rows
			}
		}
	}
</script>

<style>

</style>
